package com.woniuxy.store.service.consumer;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.woniuxy.store.infra.model.StoreContract;
import com.woniuxy.store.infra.model.StoreInfo;
import com.woniuxy.store.infra.model.StoreWithdrawRecord;
import com.woniuxy.store.service.StoreContractService;
import com.woniuxy.store.service.StoreInfoService;
import com.woniuxy.store.service.StoreWithdrawRecordService;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
@RocketMQMessageListener(consumerGroup = "withdraw",topic = "withdraw_record")
public class WithdrawRecordConsumer implements RocketMQListener<StoreWithdrawRecord> {

    @Resource
    private StoreWithdrawRecordService recordService;

    @Override
    public void onMessage(StoreWithdrawRecord storeWithdrawRecord) {
        //记录提现
        recordService.save(storeWithdrawRecord);
    }
}
